switch: Use getter for gtk-enable-animations
authorMatthias Clasen <mclasen@redhat.com>
Sun, 1 May 2016 04:40:08 +0000 (00:40 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 1 May 2016 04:40:08 +0000 (00:40 -0400)
gtk/gtkswitch.c

index 1cab4ec8a821fd5b888fed9ba6439e36294992a6..ce99a5b85ee8ed41bd331e33fc8cd6207450c476 100644 (file)
@@ -68,6 +68,7 @@
 #include "gtkcssshadowsvalueprivate.h"
 #include "gtkcssnumbervalueprivate.h"
 #include "gtkprogresstrackerprivate.h"
+#include "gtksettingsprivate.h"
 
 #include "fallback-c89.c"
 
@@ -177,13 +178,8 @@ static void
 gtk_switch_begin_toggle_animation (GtkSwitch *sw)
 {
   GtkSwitchPrivate *priv = sw->priv;
-  gboolean animate;
 
-  g_object_get (gtk_widget_get_settings (GTK_WIDGET (sw)),
-                "gtk-enable-animations", &animate,
-                NULL);
-
-  if (animate)
+  if (gtk_settings_get_enable_animations (gtk_widget_get_settings (GTK_WIDGET (sw))))
     {
       gtk_progress_tracker_start (&priv->tracker, 1000 * ANIMATION_DURATION, 0, 1.0);
       if (priv->tick_id == 0)